namespace MvvmFx.Common.ViewModels.Factories
{
    /// <summary>
    /// The ICreateCriteria interface is used to pass context information 
    /// to the Create method of an <see cref="IViewModelFactory{T}"/> to
    /// specify how and what it should create.
    /// </summary>
    /// <remarks>
    /// This base interface just provides a string Key property
    /// by default, but can be extended by custom implementations to
    /// add custom criteria properties like Ids, Guids, urls or 
    /// model-specific data.
    /// </remarks>
    /// <example>
    /// The following example passes an implementation of ICreateCriteria to an
    /// <see cref="IViewModelFactory{T}"/> to tell the factory which data
    /// to load from the model.
    /// <code>
    ///   var personFactory = container.Resolve<IViewModelFactory<PersonViewModel>>();
    ///   personViewModel = personFactory.Create(new CreateCriteria { Key = "123" });
    /// </code>
    /// </example>
    public interface ICreateCriteria
    {
        /// <summary>
        /// Gets or sets the Key of the model object that the <see cref="IViewModelFactory{T}"/> should load from
        /// </summary>
        string Key { get; set; }

        /// <summary>
        /// Gets whether it is an empty criteria
        /// </summary>
        bool IsEmpty { get;  }
    }
}